<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet"/>
    <link th:href="@{/css/loginAndregister.css}" rel="stylesheet"/>
    <script th:src="@{/layui/layui.js}"></script>
</head>
<body>
<div class="Sing-up-form">
    <h1>注册</h1>
    <form class="layui-form" action="/register" method="post">
        <input type="text"  lay-verify="required" class="input-box" placeholder="昵称" name="name">
        <input type="text" lay-verify="required" class="input-box" placeholder="账号" name="account">
        <input type="password" lay-verify="pass|required" class="input-box" placeholder="密码" name="password">
        <input type="text" lay-verify="required|phone" class="input-box" placeholder="电话" name="phone">
        <input type="email" lay-verify="required|email" class="input-box" placeholder="邮箱" name="email">
        <input type="text" lay-verify="required" class="input-box" placeholder="公司名称" name="companyName">

        <div class="layui-form-item select">
            <label class="layui-form-label">用户角色</label>
            <div class="layui-input-block">
                <select name="status" lay-filter="aihao" >
                    <option value=""></option>
                    <option value="0">招标人</option>
                    <option value="1" selected="">投标人</option>
                    <option value="2">评标专家</option>
                    <option value="3">招标委托人</option>
                    <option value="4">管理员</option>
                </select>
            </div>
        </div>
        <button type="submit" class="signup-btn"  lay-submit="">注册</button>
    </form>
</div>
</body>
<script>
    layui.use('form', function () {
        var form = layui.form;

        //自定义验证规则
        form.verify({
            name: function (value) {
                if (value.length == 0) {
                    return '名称必须填写';
                }
            }
            , pass: [
                /^[\S]{6,12}$/
                , '密码必须6到12位，且不能出现空格'
            ]
        });
    })
</script>
</html>